from pydantic import BaseModel

def make_fid(name: str, size: int):
    res = size
    buffer = name.encode('utf8')
    for b in buffer:
        res *= b
    return res % (2**32-1)

class FileInfo(BaseModel):
    fid:int
    file_name:str
    file_path:str
    file_size:int
    # def __init__(__pydantic_self__, **data) -> None:
    #     fid=make_fid(data['file_path'],data['file_size'])
    #     data['fid']=fid
    #     super().__init__(**data)